/**
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
*
* EhrCollegeServiceAuto
* 学校档案
*
* 修改纪录
* 2020-09-03 版本：1.0 wangxinhua 创建。
* @version 版本：1.0
* @author 作者：wangxinhua
* 创建日期：2020-09-03
*/

package com.topscomm.base.service.impl.auto;

import com.topscomm.base.BaseService;
import com.topscomm.base.dao.IBaseCollegeDao;
import com.topscomm.base.pojo.BaseCollegeEntity;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;

import javax.annotation.Resource;
import java.util.Map;


public class BaseCollegeServiceAuto extends BaseService<BaseCollegeEntity, IBaseCollegeDao> {

	/**
	 * @author: wangxinhua
	 * @date: 2020-09-03
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("collegelevel") != null) {
			temp = mapRow.get("collegelevel").toString();
			mapRow.put("dispcollegelevel", datacodeCache.getValueDynamic("EhrCollegeLevel", temp, "code", "name"));
		}
		if (mapRow.get("institutiontype") != null) {
			temp = mapRow.get("institutiontype").toString();
			mapRow.put("dispinstitutiontype", datacodeCache.getValueDynamic("EhrInstitutionType", temp, "code", "name"));
		}
		if (mapRow.get("schooltype") != null) {
			temp = mapRow.get("schooltype").toString();
			mapRow.put("dispschooltype", datacodeCache.getValueDynamic("EhrSchoolType", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_EhrCollege", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "ehrCollegeDao")
	public void setDao(IBasicDao<BaseCollegeEntity> dao) {
		super.setDao(dao);
	}
}
